package com.smzd.projforge.domain;

import com.smzd.core.annotations.ModuleGroup;
import com.smzd.core.domain.BaseScopeEntity;

@ModuleGroup(value="projforge", moduleName="attribute", moduleNames="attributes")
public class DynaAttribute extends BaseScopeEntity<DynaClass> {
	private static final long serialVersionUID = 4960841797648133088L;
	public static final int TYPE_STRING = 0;
	public static final int TYPE_INTEGER = 1;
	public static final int TYPE_LONG = 2;
	public static final int TYPE_FLOAT = 3;
	public static final int TYPE_DOUBLE = 4;
	public static final int TYPE_BOOLEAN = 5;
	public static final int TYPE_DATE = 6;
	public static final int TYPE_TIME = 7;
	public static final int TYPE_DATETIME = 8;
	public static final int TYPE_DYNACLASS = 9;//动态类，构建一对多关系的从方
	public static final int TYPE_SYS_MEETING = 10;
	public static final int TYPE_SYS_GROUP = 11;
	public static final int TYPE_SYS_USER = 12;

	private String attributeName;
	// 类型
	private int type;
	// type=TYPE_DYNACLASS(9)时有效，具体的动态类
	private DynaClass refClass;
	// 长度
	private int size;
	// 数据格式
	private String format;
	// 是否可为空
	private boolean nullable;
	// 是否是一对多的列表
	private boolean subList;
	// 载体属性，不需要持久化到数据库中
	private boolean carrier;
	// 一次插入数据库，不需要更新的属性
	public boolean eternal;

	public boolean isEternal() {
		return eternal;
	}

	public void setEternal(boolean eternal) {
		this.eternal = eternal;
	}

	public boolean isCarrier() {
		return carrier;
	}

	public void setCarrier(boolean carrier) {
		this.carrier = carrier;
	}

	public int getType() {
		return type;
	}

	public void setType(int type) {
		this.type = type;
	}

	public DynaClass getRefClass() {
		return refClass;
	}

	public void setRefClass(DynaClass refClass) {
		this.refClass = refClass;
	}

	public int getSize() {
		return size;
	}

	public void setSize(int size) {
		this.size = size;
	}

	public String getFormat() {
		return format;
	}

	public void setFormat(String format) {
		this.format = format;
	}

	public boolean isNullable() {
		return nullable;
	}

	public void setNullable(boolean nullable) {
		this.nullable = nullable;
	}

	public boolean isSubList() {
		return subList;
	}

	public void setSubList(boolean subList) {
		this.subList = subList;
	}

	public String getAttributeName() {
		return attributeName;
	}

	public void setAttributeName(String attributeName) {
		this.attributeName = attributeName;
	}

}
